package org.xi.behavioral.visitor;

import org.xi.behavioral.visitor.api.Visitor;
import org.xi.behavioral.visitor.element.ASTNode;

import java.util.List;

/**
 * 对象结构：抽象语法树
 */
public class AST {
    List<ASTNode> nodes;

    public void traverse(Visitor visitor) {
        for (ASTNode node : nodes) {
            node.accept(visitor);
        }
    }
}